<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增档位信息（分润标准）')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-gears_info-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">品牌名称：</label>
                <div class="col-sm-8">
                    <input name="csId" id="csId" class="form-control"  type="hidden">
                    <input name="manuName" type="text" id="manuName" onclick="cs()" class="form-control" placeholder="选择厂商" readonly >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">终端型号：</label>
                <div class="col-sm-8">
                    <input name="zdId" id="zdId"    class="form-control" type="hidden">
                    <input name="model" id="model"  onclick="xh()" placeholder="选择终端" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">达标政策：</label>
                <div class="col-sm-8">
                    <input name="dbId" id="dbId"  type="hidden">
                    <input name="note" id="note"  onclick="dbZc()" placeholder="选择达标政策" class="form-control" type="text" readonly>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "gears_info/gears_info"
        $("#form-gears_info-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-gears_info-add').serialize());
            }
        }

        /**
         *选择厂商
         */
        function cs() {
            $.modal.open("选择厂商",prefix + "/cs",600,500);
        }

        /**
         *选择型号
         */
        function xh() {
            if ($("#csId").val().length == 0){
                layer.msg('请先选择厂商',{icon: 2,time:1000});
                return;
            }
            var csId = $("#csId").val();
            $.modal.open("选择型号",prefix + "/xh?manu_code=" + csId,600,500);
        }

        /**
         * 选择达标
         */
        function dbZc() {
            $.modal.open("选择政策",ctx + "CkPosReturn/CkPosReturn/one",800,600);
        }

    </script>
</body>
</html>